package com.day0928.polymorphic;

//  同一种事物 条件不同 产生的结果也不同
public class Pet {
    protected String name;
    protected int health;
    protected int love;

    public Pet() {
    }

    public Pet(String name, int health, int love) {
        this.name = name;
        this.health = health;
        this.love = love;
    }

    public void show(){
        System.out.println("名字：" + this.name);
        System.out.println("健康值：" + this.health);
        System.out.println("喜爱度：" + this.love);
    }

    public void eat() {
        System.out.println("父类宠物吃的方法！");
    }
    public void toHospotial(){
        System.out.println("父类宠物去医院的方法！");
    }
}
